#pragma once

#ifndef SOUNDHARDWARE_H
#define SOUNDHARDWARE_H

#include "Types.h"

class SoundHardware
{

public:

	SoundHardware(const byte_t * soundRegistersPtr);
	~SoundHardware();

	void				SetSoundEnable(bool value);
	sword_t *			GetBuffer() const;
	size_t				GetBufferSize() const;

	void				Play(sword_t * buffer, size_t size, size_t sampleRate);

	void				SetEnabled(bool value);
	bool				IsEnabled() const;

private:

	sword_t *			m_soundPROM;
	bool				m_isEnabled;
	size_t				m_counters[3];
	const byte_t *		m_registers;

};

inline void SoundHardware::SetEnabled(bool value)
{
	m_isEnabled = value;
}

inline bool SoundHardware::IsEnabled() const
{
	return m_isEnabled;
}

#endif

